package cn.wolfcode.wolf2w.business.util;

import lombok.Getter;

@Getter
public enum OrderType {
    TYPE1(1,"create_time"),
    TYPE2(2,"viewnum");

    private Integer type;
    private String order;

    OrderType(Integer type, String order) {
        this.type = type;
        this.order = order;
    }
    public static OrderType getOrderByType(Integer type){
        for (OrderType value: OrderType.values()){
            if (value.getType().equals(type)){
                return value;
            }
        }
        return null;
    }
}
